home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Internet Pratica
/
IPRAT_01.iso
/
SQL
/
ariacom
/
br15Evaluation.exe
/
br15Evaluation
/
ASP SCripts
/
vbItemDisplay.asp
< prev
next >
Wrap
Text File
|
2002-09-09
|
9KB
|
224 lines
<%
'
' Ariacom Business Reports
' Copyright 2001-2002, ARIACOM SARL, Geneva, Switzerland
' All rights reserved
' www.ariacom.com
'
'
'startGenericItems
'
sub startGenericItems(theNode)
Response.Write gStrBeforeItem
Response.Write "<input name=""" & kStrPrefixTagName & theNode.getAttribute(kXml_AttributeId) & """ value=""" & theNode.getAttribute(kXml_AttributeDataTag) &""" type=""hidden"">"
Response.Write theNode.getAttribute(kXml_AttributeLabel) & gStrAfterLabel
end sub
'
'stopGenericItems
'
sub stopGenericItems(theNode)
Response.Write gStrAfterItem
end sub
'
'itemActionSubmitDisplay
'
sub itemActionSubmitDisplay(theNode)
'Set the action buttons
if theNode.getAttribute(kXml_AttributeIdent) <> "" then
Response.Write "<input "
call setTagAttribute("name", kStrPrefixIdent & theNode.text) 'Name
call setTagAttribute("value", theNode.getAttribute(kXml_AttributeIdent)) 'Value
Response.Write " type=""hidden"">"
end if
if theNode.getAttribute(kXml_AttributeParam) <> "" then
Response.Write "<input "
call setTagAttribute(" name", kStrPrefixParam & theNode.text) 'Name
call setTagAttribute("value", theNode.getAttribute(kXml_AttributeParam)) 'Value
Response.Write " type=""hidden"">"
end if
Response.Write gStrBeforeItem & "<input "
call setTagAttribute("name", kStrPrefixNavigation & theNode.text) 'Name
call setTagAttribute("value", theNode.getAttribute(kXml_AttributeLabel)) 'Value
call setTagAttribute("alt", theNode.getAttribute(kXml_AttributeLabel)) 'Alt
if theNode.getAttribute(kXml_AttributeCloseWindow) = kXml_AttributeValueYes then
call setTagAttribute("type", "button") 'Type
call setTagAttribute("onclick", "self.close()") 'close this window
elseif theNode.getAttribute(kXml_AttributeNewWindow) = kXml_AttributeValueYes then
call setTagAttributeDefault("type", gStrInputType, "button") 'Type
dim cmd
cmd = "javascript:Item('" & buildURLParam(theNode.text, theNode.getAttribute(kXml_AttributeIdent), theNode.getAttribute(kXml_AttributeParam))
cmd = cmd & "','" & Session("windowCount") & "')"
Session("windowCount") = Session("windowCount") + 1
call setTagAttribute("onclick", cmd) 'open in new window
else
call setTagAttributeDefault("type", gStrInputType, "submit") 'Type
end if
Response.Write gStrInputEx & ">" & gStrAfterItem
end sub
'
'itemActionLinkDisplay
'
sub itemActionLinkDisplay(theNode)
'Display links
Response.Write gStrBeforeItem & "<a href="
if theNode.getAttribute(kXml_AttributeNewWindow) = kXml_AttributeValueYes then Response.Write """javascript:Item('"
Response.Write buildURLParam(theNode.text, theNode.getAttribute(kXml_AttributeIdent), theNode.getAttribute(kXml_AttributeParam))
if theNode.getAttribute(kXml_AttributeNewWindow) = kXml_AttributeValueYes then
Response.Write "','" & Session("windowCount")
Response.Write "')"""
Session("windowCount") = Session("windowCount") + 1
else
if theNode.getAttribute(kXml_AttributeFrameName) <> "" then
Response.Write " target=""" & theNode.getAttribute(kXml_AttributeFrameName) & """"
else
Response.Write " target=""" & gStrMainFrameName & """"
end if
end if
Response.Write gStrInputEx & ">" & theNode.getAttribute(kXml_AttributeLabel) & gStrAfterLabel & "</a>" & gStrAfterItem
end sub
'
'itemDisplay
'
sub itemDisplay(theNode)
Response.Write gStrBeforeItem & theNode.getAttribute(kXml_AttributeLabel) & gStrAfterLabel
Response.Write theNode.text
call stopGenericItems(theNode)
end sub
'
'itemStringDisplay
'
sub itemStringDisplay(theNode)
call startGenericItems(theNode)
Response.Write "<input "
call setTagAttributeDefault("type", gStrInputType, "text") 'Type
call setTagAttribute("name", theNode.getAttribute(kXml_AttributeId)) 'Name
call setTagAttribute("value", theNode.text) 'Value
call setTagAttributeDefault("maxLength", theNode.getAttribute(kXml_AttributeMaxLength), kStrDefaultInputMaxLength) 'MaxLength
call setTagAttributeDefault("size", gStrInputSize, kStrDefaultInputSize) 'Size
Response.Write gStrInputEx & ">"
call stopGenericItems(theNode)
end sub
'
'itemMultiStringDisplay
'
sub itemMultiStringDisplay(theNode)
call startGenericItems(theNode)
Response.Write "<textarea "
call setTagAttribute("name", theNode.getAttribute(kXml_AttributeId)) 'Name
call setTagAttributeDefault("cols", gStrTextAreaCols, kStrDefaultTextAreaCols) 'Cols
call setTagAttributeDefault("rows", gStrTextAreaRows, kStrDefaultTextAreaRows) 'Rows
Response.Write gStrTextAreaEx & ">"
dim childValue
For Each childValue In theNode.childNodes
Response.Write childValue.text & VbCrLf
Next
Response.Write "</textarea>"
call stopGenericItems(theNode)
end sub
'
'itemNumericDisplay
'
sub itemNumericDisplay(theNode)
call startGenericItems(theNode)
'Display output
Response.Write "<input "
call setTagAttributeDefault("type", gStrInputType, "text") 'Type
call setTagAttribute("name", theNode.getAttribute(kXml_AttributeId)) 'Name
call setTagAttribute("value", theNode.text) 'Value
call setTagAttributeDefault("size", gStrInputSize, kStrDefaultInputSize) 'Size
Response.Write gStrInputEx & ">"
call stopGenericItems(theNode)
end sub
'
'itemDateTimeDisplay
'
sub itemDateTimeDisplay(theNode)
'same as string
itemStringDisplay(theNode)
end sub
'
'itemBooleanDisplay
'
sub itemBooleanDisplay(theNode)
Response.Write "<input name=""" & kStrPrefixTagName & theNode.getAttribute(kXml_AttributeId) & """ value=""" & theNode.getAttribute(kXml_AttributeDataTag) &""" type=""hidden"">"
if theNode.getAttribute(kXml_AttributeIsCheckbox) = kXml_AttributeValueYes then
'boolean as a checkbox, set an hidden tag with the value not checked
Response.Write gStrBeforeItem
Response.Write "<input value=""1"" name=""" & theNode.getAttribute(kXml_AttributeId) & """ type=""checkbox"""
if theNode.text="1" then Response.Write " checked " end if
Response.Write ">"
'add special tag for value 0 of the check box
Response.Write "<input name=""" & kStrPrefixTagName & theNode.getAttribute(kXml_AttributeId)& gTagCheckBoxExist & """ value=""" & theNode.getAttribute(kXml_AttributeDataTag) &""" type=""hidden"">"
Response.Write "<input name=""" & theNode.getAttribute(kXml_AttributeId) & gTagCheckBoxExist & """ value=""0"" type=""hidden"">"
Response.Write theNode.getAttribute(kXml_AttributeLabel)
else
'radio type
Response.Write gStrBeforeItem & theNode.getAttribute(kXml_AttributeLabel)
Response.Write "<input name=""" & theNode.getAttribute(kXml_AttributeId) & """ value=""1"" type=""radio"""
if theNode.text="1" then Response.Write " checked " end if
Response.Write " value=""" & theNode.text & """>" & theNode.getAttribute(kXml_AttributeLabelYes)
Response.Write gStrAfterLabel & "<input name=""" & theNode.getAttribute(kXml_AttributeId) & """ value=""0"" type=""radio"""
if theNode.text="0" then Response.Write " checked " end if
Response.Write " value=""" & theNode.text & """>" & theNode.getAttribute(kXml_AttributeLabelNo)
end if
call stopGenericItems(theNode)
end sub
'
'itemEnumDisplay
'
sub itemEnumDisplay(theNode)
'add special tag to detect the list box
Response.Write "<input name=""" & kStrPrefixTagName & theNode.getAttribute(kXml_AttributeId)& gTagListBoxExist & """ value=""" & theNode.getAttribute(kXml_AttributeDataTag) &""" type=""hidden"">"
Response.Write "<input name=""" & theNode.getAttribute(kXml_AttributeId) & gTagListBoxExist & """ value=""0"" type=""hidden"">"
call startGenericItems(theNode)
'Select
Response.Write "<select "
call setTagAttribute("name", theNode.getAttribute(kXml_AttributeId)) 'Name
call setTagAttribute("value", theNode.text) 'Value
if theNode.getAttribute(kXml_AttributeMultiple) = kXml_AttributeValueYes then
Response.Write " multiple "
call setTagAttributeDefault("size", gStrSelectSize, kStrDefaultSelectSize) 'Size
elseif gStrSelectSize <> "" then
call setTagAttribute("size", gStrSelectSize) 'Size
end if
Response.Write gStrSelectEx & ">"
'select the ranges
dim childRange, childValue
For Each childRange In theNode.selectSingleNode("./" & kXml_TagItemEnumRange).childNodes
Response.Write "<option value=""" & childRange.text & """"
'Select the right value
For Each childValue In theNode.selectSingleNode("./" & kXml_TagItemEnumValue).childNodes
if childValue.text = childRange.text then
Response.Write " selected"
end if
Next
Response.Write ">" & childRange.getAttribute(kXml_AttributeLabel)
Next
Response.Write "</select>"
call stopGenericItems(theNode)
end sub
%>